package com.hh.example.SpringListener;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * Created by Administrator on 16-3-23.
 */
@Component
public class MyListenerNormal implements ApplicationListener {
    @Override
    public void onApplicationEvent(ApplicationEvent applicationEvent) {
        if(applicationEvent instanceof PeopleEvent){
            System.out.println("===========这是通用监听器");
            PeopleEvent peopleEvent = (PeopleEvent)applicationEvent;
            System.out.println("---:"+peopleEvent.toString());
        }
    }
}
